import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ViolationAlarmVO, ViolationAlarmForm, ViolationAlarmQuery } from '@/api/system/violationAlarm/types';

/**
 * 查询人员违规报警列表
 * @param query
 * @returns {*}
 */

export const listViolationAlarm = (query?: ViolationAlarmQuery): AxiosPromise<ViolationAlarmVO[]> => {
  return request({
    url: '/system/violationAlarm/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询人员违规报警详细
 * @param id
 */
export const getViolationAlarm = (id: string | number): AxiosPromise<ViolationAlarmVO> => {
  return request({
    url: '/system/violationAlarm/' + id,
    method: 'get'
  });
};

/**
 * 新增人员违规报警
 * @param data
 */
export const addViolationAlarm = (data: ViolationAlarmForm) => {
  return request({
    url: '/system/violationAlarm',
    method: 'post',
    data: data
  });
};

/**
 * 修改人员违规报警
 * @param data
 */
export const updateViolationAlarm = (data: ViolationAlarmForm) => {
  return request({
    url: '/system/violationAlarm',
    method: 'put',
    data: data
  });
};

/**
 * 删除人员违规报警
 * @param id
 */
export const delViolationAlarm = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/violationAlarm/' + id,
    method: 'delete'
  });
};
